<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>ACGAN Generator</title>
    <meta name="author" content="zchholmes / https://github.com/zchholmes">
    <meta name="author" content="syt123450 / https://github.com/syt123450">
    <style>

        html, body {
            margin: 0;
            padding: 0;
            width: 100%;
            height: 100%;
        }

        #container {
            width: 100%;
            height: 100%;
        }

        #loadingPad {
            position: fixed;
            height: 100%;
            width: 100%;
            top: 0;
            left: 0;
            background-color: #031D32;
        }

        #loading {
            position: fixed;
            width: 400px;
            height: 300px;
            top: 200px;
            left: 500px;
        }

    </style>
</head>
<body>
<div id="container"></div>
<div id="loadingPad">
    <img id="loading" src="./assets/loading.gif">
</div>

<script src="../lib/jquery.min.js"></script>
<script src="../lib/three.min.js"></script>
<script src="../lib/stats.min.js"></script>
<script src="../lib/tween.min.js"></script>
<script src="../lib/TrackballControls.js"></script>
<script src="../lib/tf.min.js"></script>
<script src="../../dist/tensorspace.js"></script>

<script>

    let modelContainer = document.getElementById( "container" );

    let model = new TSP.models.Sequential( modelContainer, {

		stats: true,
        feedInputs: [ 0 ]

    } );

    model.add( new TSP.layers.Input1d() );

    model.add( new TSP.layers.Dense( {

		paging: true,
		segmentLength: 400,
        overview: true

    } ) );

    model.add(new TSP.layers.Reshape() );

    model.add( new TSP.layers.UpSampling2d() );

    model.add( new TSP.layers.Conv2d() );

    model.add( new TSP.layers.UpSampling2d() );

    model.add( new TSP.layers.Conv2d() );

    model.add( new TSP.layers.Conv2d() );

    model.load( {

        type: "tfjs",
        url: './acganGenModel/model.json'

    } );

    let randomData = tf.randomNormal( [ 1,100 ] ).dataSync();

    model.init( function() {

        model.predict( [ randomData, [ 0 ] ] );
		$( "#loadingPad" ).hide();

    } );

</script>

</body>
</html>